Skip to content

refactor: merge PYAUTO_DISABLE_CRITICAL_CAUSTICS into PYAUTO_FAST_PLOTS#340

Merged
Jammy2211 merged 1 commit intomainfrom
feature/merge-fast-plot-env-vars
Apr 12, 2026
Merged

refactor: merge PYAUTO_DISABLE_CRITICAL_CAUSTICS into PYAUTO_FAST_PLOTS#340
Jammy2211 merged 1 commit intomainfrom
feature/merge-fast-plot-env-vars

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Fold the PYAUTO_DISABLE_CRITICAL_CAUSTICS plot-speedup flag into PYAUTO_FAST_PLOTS so a single env var governs both tight_layout() skipping and critical-curve/caustic overlay skipping. Every workspace and release config already set both flags together for the same purpose (cheaper plots during smoke tests and release builds) — one flag is simpler to document, set, and reason about.

Closes #339.

API Changes

Environment variable only — no Python API changes. PYAUTO_DISABLE_CRITICAL_CAUSTICS is retired; set PYAUTO_FAST_PLOTS=1 instead to skip both tight_layout() and critical-curve/caustic overlay computation. Callers that only set PYAUTO_DISABLE_CRITICAL_CAUSTICS will no longer skip overlays — they must migrate to PYAUTO_FAST_PLOTS=1.

Paired PyAutoBuild PR removes the retired flag from the release workflow, default env vars, and docs. A follow-up workspace sweep will remove it from the autofit/autogalaxy/autolens workspace env_vars.yaml, run_scripts.sh, and CLAUDE.md files.

See full details below.

Test Plan

  • pytest test_autogalaxy/ → 811 passed (no tests reference either env var)
  • Functional guard test: with PYAUTO_FAST_PLOTS=1, both _caustics_from and _critical_curves_from short-circuit to ([], []) from both autogalaxy/plot/plot_utils.py and autogalaxy/util/plot_utils.py.
  • Negative-path: without PYAUTO_FAST_PLOTS, the guard does not fire (falls through into LensCalc).
  • grep -r PYAUTO_DISABLE_CRITICAL_CAUSTICS autogalaxy/ → zero matches.
Full API Changes (for automation & release notes)

Removed (env var)

  • PYAUTO_DISABLE_CRITICAL_CAUSTICS — no longer recognised by autogalaxy/plot/plot_utils.py::_caustics_from, _critical_curves_from, or by the identical copies in autogalaxy/util/plot_utils.py.

Changed Behaviour (env var)

  • PYAUTO_FAST_PLOTS=1 now additionally short-circuits critical-curve and caustic overlay computation in both autogalaxy/plot/plot_utils.py and autogalaxy/util/plot_utils.py, returning ([], []) from _caustics_from and _critical_curves_from. Previously this flag only skipped plt.tight_layout() (in PyAutoArray).

Migration

  • Before: PYAUTO_DISABLE_CRITICAL_CAUSTICS=1 PYAUTO_FAST_PLOTS=1 python script.py
  • After: PYAUTO_FAST_PLOTS=1 python script.py

Known follow-up (not in this PR)

  • autogalaxy/plot/plot_utils.py and autogalaxy/util/plot_utils.py are currently byte-identical duplicates of each other. Both were updated here to keep them in sync; deduplicating them is worth a separate cleanup task.

Generated with Claude Code

The critical-curve/caustic overlay skip in _caustics_from and
_critical_curves_from now keys off PYAUTO_FAST_PLOTS instead of its
own dedicated flag. In every workspace and release config the two
flags were always set together for the same purpose (faster plots
for smoke tests and release builds), so folding them into one flag
removes a layer of duplication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit 62fd74c into main Apr 12, 2026
2 checks passed
@Jammy2211 Jammy2211 deleted the feature/merge-fast-plot-env-vars branch April 12, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release Merged PR awaiting inclusion in the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: merge PYAUTO_DISABLE_CRITICAL_CAUSTICS into PYAUTO_FAST_PLOTS

1 participant